package player.ui.browse;

import java.awt.Component;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.io.File;

import javax.swing.Icon;

import player.PS;
import player.ThumbManage;
import player.Tools;
import player.mplayer.MediaInfo;
import player.ui.playlist.PlayListManage;
import player.ui.playlist.PlayListModel;

public class ListPanel extends AutoSizePanel{
	private static final long serialVersionUID = 4097344695528799601L;
	
	public ListPanel(){
		super();
	}
	
	
	
	
	void addMedia(){
		
	}
	
	void addMediaList(){
		
	}
	
	public void refresh(){
		Component[] cs=this.getComponents();
		for(Component c:cs){
			ImageButton b=(ImageButton)c;
			b.ImgButtonItem.refresh();
		}
		repaint();
	}
	
	void addItem(PlayListManage pm,PlayListModel plm,
			MediaInfo media,int index,Icon icon,String text,File[] imgFile){
		add(creatButton(pm,plm, media,index, icon, text, imgFile));
	}
	
	ImageButton creatButton(PlayListManage pm,PlayListModel plm,
		MediaInfo media,int index,Icon icon,String text,File[] imgFile){
		ImageButton button=new ImageButton(pm,plm,media,index,text,icon,imgFile);
		button.addMouseMotionListener(new MouseMotionListener(){
			Point start=new Point();
			
			public void mouseDragged(MouseEvent e) {
				//System.out.println();
			}

			public void mouseMoved(MouseEvent e) {
				
			}
			
		});
		return button;
	}
	
}



